package com.jianganming.observer.demo3;


import java.util.Observable;

//Observable：jdk提供的广播者
//广播对象
public class Teacher extends Observable {

    private String message;
    private String name;


    public Teacher(String name,String message) {
        this.name = name;
        this.message = message;
    }

    public String getName() {
        return name;
    }

    public String getMessage() {
        return message;
    }


    public void change(){
        System.out.println(this.getName()+"通知："+this.getMessage());
        setChanged();
    }
}
